# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This class is auto generated by the swagger code generator program.
# https://github.com/swagger-api/swagger-codegen.git
# Do not edit the class manually.

defmodule GoogleApi.ReplicaPoolUpdater.V1beta1.Model.Operation do
  @moduledoc """
  An operation resource, used to manage asynchronous API requests.

  ## Attributes

  - clientOperationId (String.t):  Defaults to: `null`.
  - creationTimestamp (String.t): [Output Only] Creation timestamp in RFC3339 text format. Defaults to: `null`.
  - endTime (String.t):  Defaults to: `null`.
  - error (OperationError):  Defaults to: `null`.
  - httpErrorMessage (String.t):  Defaults to: `null`.
  - httpErrorStatusCode (integer()):  Defaults to: `null`.
  - id (String.t): [Output Only] Unique identifier for the resource; defined by the server. Defaults to: `null`.
  - insertTime (String.t): [Output Only] The time that this operation was requested. This is in RFC 3339 format. Defaults to: `null`.
  - kind (String.t): [Output Only] Type of the resource. Always replicapoolupdater#operation for Operation resources. Defaults to: `null`.
  - name (String.t): [Output Only] Name of the resource. Defaults to: `null`.
  - operationType (String.t):  Defaults to: `null`.
  - progress (integer()):  Defaults to: `null`.
  - region (String.t): [Output Only] URL of the region where the operation resides. Defaults to: `null`.
  - selfLink (String.t): [Output Only] The fully qualified URL for the resource. Defaults to: `null`.
  - startTime (String.t): [Output Only] The time that this operation was started by the server. This is in RFC 3339 format. Defaults to: `null`.
  - status (String.t): [Output Only] Status of the operation. Can be one of the following: \&quot;PENDING\&quot;, \&quot;RUNNING\&quot;, or \&quot;DONE\&quot;. Defaults to: `null`.
  - statusMessage (String.t): [Output Only] An optional textual description of the current status of the operation. Defaults to: `null`.
  - targetId (String.t): [Output Only] Unique target id which identifies a particular incarnation of the target. Defaults to: `null`.
  - targetLink (String.t): [Output Only] URL of the resource the operation is mutating. Defaults to: `null`.
  - user (String.t):  Defaults to: `null`.
  - warnings ([OperationWarnings]):  Defaults to: `null`.
  - zone (String.t): [Output Only] URL of the zone where the operation resides. Defaults to: `null`.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :clientOperationId => any(),
          :creationTimestamp => any(),
          :endTime => any(),
          :error => GoogleApi.ReplicaPoolUpdater.V1beta1.Model.OperationError.t(),
          :httpErrorMessage => any(),
          :httpErrorStatusCode => any(),
          :id => any(),
          :insertTime => any(),
          :kind => any(),
          :name => any(),
          :operationType => any(),
          :progress => any(),
          :region => any(),
          :selfLink => any(),
          :startTime => any(),
          :status => any(),
          :statusMessage => any(),
          :targetId => any(),
          :targetLink => any(),
          :user => any(),
          :warnings => list(GoogleApi.ReplicaPoolUpdater.V1beta1.Model.OperationWarnings.t()),
          :zone => any()
        }

  field(:clientOperationId)
  field(:creationTimestamp)
  field(:endTime)
  field(:error, as: GoogleApi.ReplicaPoolUpdater.V1beta1.Model.OperationError)
  field(:httpErrorMessage)
  field(:httpErrorStatusCode)
  field(:id)
  field(:insertTime)
  field(:kind)
  field(:name)
  field(:operationType)
  field(:progress)
  field(:region)
  field(:selfLink)
  field(:startTime)
  field(:status)
  field(:statusMessage)
  field(:targetId)
  field(:targetLink)
  field(:user)
  field(:warnings, as: GoogleApi.ReplicaPoolUpdater.V1beta1.Model.OperationWarnings, type: :list)
  field(:zone)
end

defimpl Poison.Decoder, for: GoogleApi.ReplicaPoolUpdater.V1beta1.Model.Operation do
  def decode(value, options) do
    GoogleApi.ReplicaPoolUpdater.V1beta1.Model.Operation.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.ReplicaPoolUpdater.V1beta1.Model.Operation do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
